<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
  <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
  <style>
    .fade-enter-active, .fade-leave-active {
        transition: opacity .5s;
    }
    .fade-enter, .fade-leave-to {
        opacity: 0;
    }
  </style>
</head>
<body>
<div id="app">
  <button v-on:click="show=!show">button</button>
  <transition name="fade">
    <p v-if="show">你好</p>
  </transition>
</div>
</body>
<script>
  new Vue({
    el: '#app',
    data:{
      show: true
    }
  })
</script>
</html>